package com.tekj.cxqcb.view.Module.activity;

import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;


import com.tekj.cxqcb.R;

import butterknife.BindView;
import butterknife.OnClick;
import common.base.activity.BaseActivity;

public class WithdrawalEndActivity extends BaseActivity {
    @BindView(R.id.img_back)
    ImageView imgBack;
    @BindView(R.id.tv_l)
    TextView tvL;
    @BindView(R.id.ll_back)
    LinearLayout llBack;
    @BindView(R.id.tv_title)
    TextView tvTitle;
    @BindView(R.id.iv_r)
    ImageView ivR;
    @BindView(R.id.tv_r)
    TextView tvR;
    @BindView(R.id.ll_right)
    LinearLayout llRight;
    @BindView(R.id.rl_title_bg)
    RelativeLayout rlTitleBg;
    @BindView(R.id.img_r)
    ImageView imgR;
    @BindView(R.id.tv_msg)
    TextView tvMsg;
    @BindView(R.id.tv_msg2)
    TextView tvMsg2;
    @BindView(R.id.tv_name)
    TextView tvName;
    @BindView(R.id.tv_num)
    TextView tvNum;

    String msg, alipayName, alipayAccount, num;
    int type;

    @Override
    public void init() {
        tvTitle.setText("提现结果");
        num = getIntent().getStringExtra("num");
        msg = getIntent().getStringExtra("msg");
        type = getIntent().getIntExtra("type", 0);
        alipayName = getIntent().getStringExtra("alipayName");
        alipayAccount = getIntent().getStringExtra("alipayAccount");
        setViewData(type);


    }

    @Override
    public int setLayout() {
        return R.layout.activity_withdrawal_end;
    }

    @Override
    public void initLoadStart() {

    }

    @Override
    public void initLoadEnd() {

    }

    @Override
    public void initBindingView(Object mBean) {

    }


    @OnClick({R.id.ll_back, R.id.ll_right})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.ll_back:
                finish();
                break;
            case R.id.ll_right:
                finish();
                break;
        }
    }

    void setViewData(int type) {
        imgR.setImageResource(type == 1 ? R.mipmap.icon_select_finish : R.mipmap.icon_select_no);
        tvMsg.setText(type == 1 ? "提现成功" : "提现失败");
        tvMsg2.setText(type == 1 ? "提现后预计一个工作日内到账" : "失败原因：" + msg);
        tvName.setText(alipayName + "(" + alipayAccount + ")");
        tvNum.setText(num + "元");
    }
}
